﻿Imports DTO
Imports System.Data.OleDb
Public Class CDiemMonHocDAO
    Public Function LayThongTinDiemMonHoc(ByVal _CTldto As CChiTietLopDTO) As List(Of CDiemMonHocDTO)
        Dim cnn As OleDbConnection = CDaTaProviderDAO.ConnectDB()
        cnn.Open()
        Dim _strlaydl = "select MaDiemMonHoc,MaLop,MaMonHoc,TenHocKy from DIEMMONHOC where MaLop=" + _CTldto.MaLop.ToString() + ""
        Dim _cmd As New OleDbCommand(_strlaydl, cnn)
        Dim _ds As New List(Of CDiemMonHocDTO)
        Dim _reader As OleDbDataReader = _cmd.ExecuteReader()

        While _reader.Read()
            Dim _DMHdto As New CDiemMonHocDTO()
            _DMHdto.MaDiemMonHoc = _reader.GetInt32(0)
            _DMHdto.MaLop = _reader.GetInt32(1)
            _DMHdto.MaMonHoc = _reader.GetInt32(2)
            _DMHdto.TenHocKy = _reader.GetInt32(3)
            _ds.Add(_DMHdto)
        End While

        cnn.Close()
        Return _ds
    End Function
End Class
